package com.javakc.copyrightin.bookList.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;
import java.util.Date;
/** 书单管理*/
@Data
@Entity
@Table(name = "bms_list")
@EntityListeners(AuditingEntityListener.class)
public class BookList {
    /** 主键 */
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id")
    @ApiModelProperty(value = "书单主键，采用数据库自增的方式")
    private Integer id ;

    /** 书单名称 */
    @Column(name = "name")
    @ApiModelProperty(value = "书单名称")
    private String name ;

    /** 批次外键 */
    @Column(name = "batch_id")
    @ApiModelProperty(value = "批次外键")
    private Integer batchId ;

    /** 创建时间 */
    @Column(name = "bms_create",updatable = false)
    @ApiModelProperty(value = "创建时间", example = "2020-12-12 9:00:00")
    @CreatedDate
    @JsonFormat(pattern = "yyyy-MM-dd HH-mm-ss", timezone = "GMT+8")
    private Date bmsCreate ;

    /** 更新时间 */
    @Column(name = "bms_modified",insertable = false)
    @ApiModelProperty(value = "更新时间", example = "2020-12-12 9:00:00")
    @LastModifiedDate
    @JsonFormat(pattern = "yyyy-MM-dd HH-mm-ss", timezone = "GMT+8")
    private Date bmsModified ;

}
